import request from '@/utils/request'

/**
 *  分页查询角色列表
 * @param {*} params: 角色列表表单数据
 * @returns
 */
export const getRole = params => request.get('/sys/role', { params })
/**
 * 新增
 * @param {*} data
 * @returns
 */
export const addRole = data => request.post('/sys/role', data)
// 编辑
export const updateEdit = data => request.put('/sys/role/' + data.id, data)
/**
 * 删除
 * @param {number} id
 * @returns
 */
export const delRole = id => request.delete('/sys/role/' + id)

// 已启用的角色列表
export const getRoleList = () => request.get('/sys/role/list/enabled')
// 获取角色详情
export const getExisting = id => request.get(`/sys/role/${id}`)
// 角色权限分配-修改
export const getSave = data => request.put('/sys/role/assignPrem', data)
